//<!--成单记录-->
Vue.component('single_record', {
	props: ["parent_data"],
	template: '#single_record',
	data: function() {
		return {
			url: {
				getQACustomers: '/api/UserQuestion/GetQACustomers', //获取列表
				getUserCustomeProducts:'/api/QuestionView/GetUserCustomeProducts', //配置推荐
				getProductForCustomer:'/api/AppFun/GetProductForCustomer', //获取成单产品
			},
			users:[], //成单列表
			recommed_list:[], //配置推荐
			page: {
				pageIndex: 1,
				pageSize: 100,
				pageTotal: 0
			},
			complete_list:[], //成单产品
		}
	},
	mounted: function() {
		this.getQACustomers();
	},
	methods: {
		//获取数据
		getQACustomers: function() {
			var that = this;
			globalData.ajaxPost(this.url.getQACustomers, null, function(res) {
				var d = res.data;
				if(res.suc){
					console.log(d)
					that.users = d
				}
			})
		},
		getUserCustomeProducts:function(item){
			var that = this;
			that.parent_data.CustomerID = item.ID
			that.parent_data.isShow = true
		},
		getProductForCustomer:function(item){
			console.log(item)
			var that = this;
			var data = {
				PageIndex:1,PageSize:1000,ID:item.ID
			}
			globalData.ajaxPost(this.url.getProductForCustomer,data,function(res) {
				var d = res.data;
				if(res.suc){
					that.complete_list = res.data
					console.log(res.data)
					var top = $(document).scrollTop() + 120 + "px"
					$(".mask").show()
					$(".single_record .complete_product").show().css({"top":top})
				}
			})
		},
		hide:function(){
			$(".mask").hide()
			$(".single_record .complete_product").hide()
		},
		go_introduce:function(item){
			console.log(item)
			globalData.utils.setUrl("product_intro.html", {ProductID:item.ProductID}, true)
			

		}
	}
});
